Also cleanup IOCTL_PRIVCMD_INITDOMAIN_STORE.
Signed-off-by: Rusty Russel <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
case IOCTL_PRIVCMD_INITDOMAIN_STORE:
{
extern int do_xenbus_probe(void*);
+ unsigned long page;
if (xen_start_info.store_evtchn != 0) {
- ret = -EINVAL;
+ ret = xen_start_info.store_mfn;
break;
}
/* Allocate page. */
- xen_start_info.store_page = get_zeroed_page(GFP_KERNEL);
- if (!xen_start_info.store_page) {
+ page = get_zeroed_page(GFP_KERNEL);
+ if (!page) {
ret = -ENOMEM;
break;
}
/* We don't refcnt properly, so set reserved on page.
* (this allocation is permanent) */
- SetPageReserved(virt_to_page(xen_start_info.store_page));
+ SetPageReserved(virt_to_page(page));
/* Initial connect. Setup channel and page. */
xen_start_info.store_evtchn = data;
- ret = pfn_to_mfn(virt_to_phys((void *)xen_start_info.store_page) >>
- PAGE_SHIFT);
+ xen_start_info.store_mfn = pfn_to_mfn(virt_to_phys((void *)page) >>
+ PAGE_SHIFT);
+ ret = xen_start_info.store_mfn;
/* We'll return then this will wait for daemon to answer */
kthread_run(do_xenbus_probe, NULL, "xenbus_probe");
return err;
}
+ *out = machine_to_virt(xen_start_info.store_mfn << PAGE_SHIFT);
+ *in = *out + PAGE_SIZE / 2;
+
/* FIXME zero out page -- domain builder should probably do this*/
- memset((void *)xen_start_info.store_page, 0, PAGE_SIZE);
+ memset(*out, 0, PAGE_SIZE);
- *out = (void *)xen_start_info.store_page;
- *in = (void *)xen_start_info.store_page + PAGE_SIZE/2;
return 0;
}
void xenbus_debug_write(const char *str, unsigned int count)
{
struct xsd_sockmsg msg;
- void *out = (void *)xen_start_info.store_page;
+ void *out = machine_to_virt(xen_start_info.store_mfn << PAGE_SHIFT);
msg.type = XS_DEBUG;
msg.len = sizeof("print") + count + 1;
goto error_out;
#endif
+ *store_mfn = page_array[(vstoreinfo_start-dsi.v_start) >> PAGE_SHIFT];
+
start_info = xc_map_foreign_range(
xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
page_array[(vstartinfo_start-dsi.v_start)>>PAGE_SHIFT]);
start_info->nr_pt_frames = nr_pt_pages;
start_info->mfn_list = vphysmap_start;
start_info->domain_controller_evtchn = control_evtchn;
- start_info->store_page = vstoreinfo_start;
+ start_info->store_mfn = *store_mfn;
start_info->store_evtchn = store_evtchn;
if ( initrd_len != 0 )
{
start_info->cmd_line[MAX_GUEST_CMDLINE-1] = '\0';
munmap(start_info, PAGE_SIZE);
- /* Tell our caller where we told domain store page was. */
- *store_mfn = page_array[((vstoreinfo_start-dsi.v_start)>>PAGE_SHIFT)];
-
/* shared_info page starts its life empty. */
shared_info = xc_map_foreign_range(
xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, shared_info_frame);
memory_t mod_start; /* VIRTUAL address of pre-loaded module. */
memory_t mod_len; /* Size (bytes) of pre-loaded module. */
s8 cmd_line[MAX_GUEST_CMDLINE];
- memory_t store_page; /* VIRTUAL address of store page. */
+ memory_t store_mfn; /* MACHINE page number of shared page. */
u16 store_evtchn; /* Event channel for store communication. */
} start_info_t;